import { createStore } from '@/airstore';
import ApiClient from '@/services/apiClient';

export default createStore({
  namespace: 'MovementStore',
  movingParts: [],
  currentRack: {},
  scannedParts: [],
  setCurrentRack(rack) {
    this.currentRack = rack;
  },
  async getMaterialByRackAndPart(rackTid, rackShelfNo, partno) {
    const srRes = await ApiClient.get('amStore/v1/ScanCodeV', {
      params: {
        shelfLatticeId: rackTid,
        asdSubName: rackShelfNo,
        apCode: partno,
      },
    });
    return srRes;
  },
});
